/*
 * Cally.h
 *
 *  Created on: Jul 7, 2009
 *      Author: lfor
 */

#ifndef CALLY_H_
#define CALLY_H_

#include "Packet.h"

#include <pthread.h>

// Errors
#define CALLY_OK 						0
#define CALLY_ERROR 					-1
#define CALLY_THREAD_CREATE_ERROR 		1
#define CALLY_NAME_TOO_LONG 	 		2

#define DEFAULT_PORT 2222
#define MAX_FUNC_NUM 10

typedef char* (*CallyFunction)(char*);

typedef struct
{
	CallyFunction Function;
	char Name[MAX_NAME_SIZE];
	char Help[MAX_PARAM_SIZE];
} CallyVectorElement;



int Cally_Initialize(int PortNum);
int Cally_Finalize();
int Cally_RegisterFuntion(CallyFunction Func, char * Name, char * Help);

pthread_t Cally_CallyThreadId;


#endif /* CALLY_H_ */
